﻿@{
    ViewBag.Title = "Dashboard";
}
<link href="@Url.Content("~/Scripts/DataTables-1.8.0/media/css/demo_table.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/DataTables-1.8.0/media/js/jquery.dataTables.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var oTable = $("#tableMgmt").dataTable(
                {
                    "bPaginate": true,
                    "bLengthChange": true,
                    "bFilter": true,
                    "bSort": true,
                    "bInfo": true,
                    "bAutoWidth": true
                }
            );
            var oTable2 = $("#tableResources").dataTable(
                {
                    "bPaginate": true,
                    "bLengthChange": true,
                    "bFilter": true,
                    "bSort": true,
                    "bInfo": true,
                    "bAutoWidth": true
                }
            );
        });

        
    </script>
<br /><h2>Dashboard</h2>

<div id="lowerContainer">
        <div id="lowerContainerInner">
            <div style="overflow:visible;">
                <table class="sparePartMgmt" cellpadding="5">
                    <tr>
                        <td style="text-align:left; vertical-align:top;">
                            <div class="title">
                                <label>Orders</label>
                                <div style="float:right; display:inline;">
                                    @Html.ActionLink("Add New", "Create", "Order")&nbsp;&nbsp;<img src="../../Assets/images/add_icon.gif" alt="Add" />
                                </div>
                            </div>
                            <div class="padding">
                                @Html.Action("MyOrders")
                            </div>
                        </td>
                    </tr>
                </table>
                
                @if (TruckingApplication.Dal.Infrastructure.UserSpecifics.UserRole.ToUpper() == "ADMINISTRATOR")
                {
                    <table class="sparePartMgmt" cellpadding="5">
                        <tr>
                            <td style="text-align:left; vertical-align:top;">
                                <div class="title">
                                    <label>Users</label>
                                    <div style="float:right; display:inline;">
                                        @Html.ActionLink("Add New", "Create", "Resource")&nbsp;&nbsp;<img src="../../Assets/images/add_icon.gif" alt="Add" />
                                    </div>
                                </div>
                                <div class="padding">
                                    @Html.Action("OurResources")
                                </div>
                            </td>
                            <td style="text-align:left; vertical-align:top;">
                                <div class="title">
                                    <label>Payments</label>
                                    <div style="float:right; display:inline;">
                                        @Html.ActionLink("Add New", "Create", "Payment")&nbsp;&nbsp;<img src="../../Assets/images/add_icon.gif" alt="Add" />
                                    </div>
                                </div>
                                <div class="padding">
                                    @Html.Action("Payments")
                                </div>
                            </td>
                        </tr>
                    </table>
                }
                else
                {
                    <table class="sparePartMgmt" cellpadding="5">
                        <tr>
                            <td style="text-align:left; vertical-align:top;" colspan="2">
                                <div class="title">
                                    <label>Payments</label>
                                    <div style="float:right; display:inline;">
                                        @Html.ActionLink("Add New", "Create", "Payment")&nbsp;&nbsp;<img src="../../Assets/images/add_icon.gif" alt="Add" />
                                    </div>
                                </div>
                                <div class="padding">
                                    @Html.Action("Payments")
                                </div>
                            </td>
                        </tr>
                    </table>
                }
            </div>
        </div>
    </div>


